#ifndef _CRT_MSGQ_H_
#define _CRT_MSGQ_H_

#ifdef __cplusplus
extern "C" {
#endif

typedef struct _msgq_s _msgq_t;
typedef _queue_t _msg_q;

struct _msgq_s {
    _mutex_t lock;
    _cond_t cond;
    _msg_q queue;
    int exit;
};

int _msgq_init(_msgq_t* msgq);
int _msgq_destroy(_msgq_t* msgq);
int _msgq_produce(_msgq_t* msgq, _msg_q* queue);
int _msgq_consume(_msgq_t* msgq, _msg_q* queue);

#ifdef __cplusplus
}
#endif

#endif
